home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Answers 2002 January
/
PC Answers January 2002.7z
/
PC Answers January 2002.bin
/
graphics
/
freepixl
/
_SETUP.1
/
Checkvga.pxl
< prev
next >
Wrap
Text File
|
2000-12-23
|
5KB
|
194 lines
{-----------------------------------------------------------------------
Filename : checkVGA.pxl
Purpose : Check current Windows driver parameters
Date : v4.2 20-nov-98
Author : S.Dibbs, VYSOR Integration Inc
------------------------------------------------------------------------}
Initialize:
{ Get the screen parameters and adjust the main window for a fixed size. }
NewCaption$ = "Verify Windows Data"
UseCoordinates(METRIC) {note this is not PIXEL}
WinGetActive(OldCaption$)
WinTitle(OldCaption$,NewCaption$)
WinLocate(NewCaption$,1,1,280,210, Res)
UseBackground(TRANSPARENT,0,0,80) {Black}
DrawBackground
Restart:
GetScreenCaps(HORZRES, X_res)
GetScreenCaps(VERTRES, Y_res)
GetScreenCaps(HORZSIZE, X_size)
GetScreenCaps(VERTSIZE, Y_size)
GetScreenCaps(NUMCOLORS,Colours)
If Colours = -1 Then Colours = 4096
GetScreenCaps(BITSPIXEL,BitsPerPixel)
GetScreenCaps(PLANES,BitPlanes)
WaitInput(100)
SetMenu("Exit!",Run_Leave,
ENDPOPUP,
" ",VGA,
ENDPOPUP,
" ",SVGA,
ENDPOPUP,
" ",WKS,
ENDPOPUP,
"Vert",IGNORE,
"Red",Red,
"Green",Green,
"Blue",Blue,
"Restart",Restart,
ENDPOPUP,
"Diag",Diag,
ENDPOPUP,
"About",About,
ENDPOPUP)
Display:
Str(X_Res,X_Res$)
Str(Y_Res,Y_Res$)
Str(X_Size,X_Size$)
Str(Y_Size,Y_Size$)
Str(Colours,Colours$)
Str(BitsPerPixel,BitsPerPixel$)
Str(BitPlanes,BitPlanes$)
Line1$ = "Screen Resolution is " + X_Res$
Line1$ = Line1$ + " x "
Line1$ = Line1$ + Y_Res$
Line1$ = Line1$ + " pixels"
Line2$ = "Screen Size is " + X_Size$
Line2$ = Line2$ + " x "
Line2$ = Line2$ + Y_Size$
Line2$ = Line2$ + " millimeters"
Line3$ = "Static Number of colours is " + Colours$
Line4$ = "Bits per pixel is " + BitsPerPixel$
Line5$ = "Number of Bitplanes is " + BitPlanes$
UseFont("Arial",5,10,BOLD,NOITALIC,NOUNDERLINE,255,255,255)
DrawText(20,20,Line1$)
DrawText(20,30,Line2$)
DrawText(20,40,Line3$)
DrawText(20,50,Line4$)
DrawText(20,60,Line5$)
UseFont("Arial",3,7,BOLD,NOITALIC,NOUNDERLINE,255,255,0)
If X_Res = 640 Then Line1$ = "Hence, your monitor is VGA compatible, and"
If X_Res = 800 Then Line1$ = "Hence, your monitor is SVGA compatible, and"
If X_Res = 1024 Then Line1$ = "Hence, your monitor is XGA compatible, and"
If X_Res > 1024 Then Line1$ = "Hence, you have a high end PC, and "
If Colours < 20 Then Line2$ = "you have an older PC or early model colour Laptop."
If Colours = 20 Then Line2$ = "the number of available dynamic colours is 236."
If Colours > 20 Then Line2$ = "you are probably running a hi-colour or 24 bit video card."
Line3$ = "Number of Bitplanes is " + BitPlanes$
DrawText(20,80,Line1$)
DrawText(20,90,Line2$)
If X_Res >= 1024 Then Goto Done
Line3$ = "Concept! programs display best at higher"
Line4$ = "resolutions. Please check if your video card"
Line5$ = "and monitor supports either 800x600 or"
Line6$ = "1024x768x256 colours. Setup this mode."
DrawText(25,100,Line3$)
DrawText(25,110,Line4$)
DrawText(25,120,Line5$)
DrawText(25,130,Line6$)
{endif}
Done:
Wait_for_input:
WaitInput()
VGA:
X_Res = 640
Y_Res = 480
DrawBackground Goto Display
SVGA:
X_Res = 800
Y_Res = 600
DrawBackground Goto Display
WKS:
X_Res = 1280
Y_Res = 1024
Colours = 4096
DrawBackground Goto Display
Red:
UsePen(SOLID,1,255,0,0)
Goto Vertical
Green:
UsePen(SOLID,1,0,255,0)
Goto Vertical
Blue:
UsePen(SOLID,1,0,0,255)
Vertical:
GoSub Vertical_Drape
Goto Wait_for_input
Diag:
GoSub Diag_Drape
Goto Wait_for_input
Run_Leave:
End
About:
AboutUser("About Check VGA","Windows 95/98/NT sample application","")
Goto Wait_for_Input
{======================================================================}
{Subroutine: }
Vertical_Drape:
UseCoordinates(PIXEL)
X1 = 511 X2 = 512 X3 = 255 X4 = 768
Y1 = 1 Y2 = 768
Loop1:
DrawLine(X1,1,X1,768)
DrawLine(X2,1,X2,768)
DrawLine(X3,1,X3,768)
DrawLine(X4,1,X4,768)
If X3 = 0 Then X3 = 1
X1 = X1 - 1 X2 = X2 + 1
X3 = X3 - 1 X4 = X4 + 1
If X1 > 255 Then Goto Loop1
UseCoordinates(METRIC)
Return
{Subroutine: }
Diag_Drape:
UsePen(SOLID,1,0,128,0)
UseCoordinates(PIXEL)
X1 = 522 X2 = 777 X3 = 256 X4 = 511
Loop2:
DrawLine(X1,1,X2,768)
DrawLine(X3,1,X4,768)
X1 = X1 + 1 X2 = X2 + 1
X3 = X3 + 1 X4 = X4 + 1
If X1 < 768 Then Goto Loop2
X1 = 1 X2 = 255
Loop3:
DrawLine(X1,1,X2,768)
X1 = X1 + 1 X2 = X2 + 1
If X1 < 250 Then Goto Loop3
UseCoordinates(METRIC)
Return